Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Add support for serial protocol, plus factory reset command #2

Merged
merged 4 commits into from
Jan 30, 2019

Conversation

tve
Copy link
Contributor

@tve tve commented Jan 28, 2019

I needed serial support and added it. Example 11 shows its use as well as code to change baud rate (which can be a bit tricky).

@nseidle
Copy link
Member

nseidle commented Jan 28, 2019

This looks great! Thank you. I'll give it a try tonight.

@nseidle
Copy link
Member

nseidle commented Jan 29, 2019

I'm impressed you dug in deep enough into my code to figure out the packetCfg structure. I like factoryReset().

I really want to accept this PR but there's some issues.

  • Serial.printf() doesn't compile. Please assume user has stock Arduino without printf wrapper.
  • Use debug.print instead of Serial.print so that user can pipe debug to port of their choice.
  • (Nit) Use a uint8_t instead of an int, save a byte.
  • Split hard reset out to its own function. I use hard reset (cold start) to test TTFF more than I use factory reset.
  • Some modules (ZED-F9P) have two UARTs. If would be nice to have setBaudRate() support multiple ports.

Overall, I like it a lot. Thanks for the help! I've got a SAM-M8Q working (surprisingly indoors) using serial. Works well.

@tve
Copy link
Contributor Author

tve commented Jan 29, 2019

Cool, I'll fix. Some of the issues are due to me using a Particle Mesh device, so it's "arduinoish".

@tve
Copy link
Contributor Author

tve commented Jan 29, 2019

I believe I addressed all your concerns. I cannot test setSerialRate on the second uart port as my devices don't have one. The code for this is simple, though. LMK if there's more you'd like see changed.

@nseidle
Copy link
Member

nseidle commented Jan 30, 2019

Excellent, excellent. All my concerns are addressed. Thank you very much.

@nseidle nseidle merged commit 08e78b6 into sparkfun:master Jan 30, 2019
@nseidle
Copy link
Member

nseidle commented Jan 30, 2019

You additions should be available in v1.2.0 soon. I modified Ex11 to use software serial as most users (made up statistic) don't have Serial1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants